From: Florian Müllner Date: Thu, 31 Aug 2023 17:40:43 +0000 (+0200) Subject: environment: Add Meta.Rectangle compatibility X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~320^2^2~22 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f1317f07db8da49ad921473c5ccc9b31719b3aee;p=gnome-shell.git environment: Add Meta.Rectangle compatibility Meta.Rectangle was replaced by Mtk.Rectangle. Mutter defines a typedef for compatibility, but it turns out that gjs fails to pick it up. Work around that by adding a small compatibility function that prints a deprecation warning and returns the expected Mtk.Rectangle. Part-of: --- diff --git a/js/ui/environment.js b/js/ui/environment.js index a7328f6bd..868c97c07 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -10,6 +10,7 @@ import Gio from 'gi://Gio'; import GLib from 'gi://GLib'; import GObject from 'gi://GObject'; import Meta from 'gi://Meta'; +import Mtk from 'gi://Mtk'; import Polkit from 'gi://Polkit'; import Shell from 'gi://Shell'; import St from 'gi://St'; @@ -322,6 +323,11 @@ Object.defineProperty(Clutter.Actor.prototype, 'actor', { }, }); +Meta.Rectangle = function (params = {}) { + console.warn('Meta.Rectangle is deprecated, use Mtk.Rectangle instead'); + return new Mtk.Rectangle(params); +}; + Gio.File.prototype.touch_async = function (callback) { Shell.util_touch_file_async(this, callback); };